Skip to content

Conversation

@madawei2699
Copy link
Contributor

Description

This PR introduces a complete plugin system for the AgentForge framework, enabling extensibility and modular functionality. The plugin system allows developers to create, register, and use custom plugins that can add new tools, notification channels, and primitives to the framework without modifying core code.

Core Components Implemented

  • Plugin Behavior: Defined a formal plugin behavior interface that plugins must implement
  • Plugin Manager: Created a central registry for managing plugin lifecycle (loading, unloading, listing)
  • Tools Registry: Implemented a registry for plugin-provided tools with dynamic discovery
  • Notification System: Built a notification registry and channel system for plugins to hook into
  • Plugin Integration: Added seamless integration with existing Flow and Signal systems

Technical Details

  • Implemented the Plugin behavior with required callbacks (init, register_tools, metadata, etc.)
  • Created the PluginManager GenServer to manage plugin state and registration
  • Developed the Tools registry for function registration and discovery
  • Built the Notification.Registry for managing communication channels
  • Added HTTP plugin implementation as a reference plugin
  • Created comprehensive testing infrastructure for plugins

Testing

The implementation includes extensive tests covering all aspects of the plugin system:

# Run plugin system tests
mix test test/agent_forge/plugin_system_test.exs

# Run the example tests
mix test test/agent_forge/examples_test.exs

# Run all tests
mix test

For more details, refer to this design doc.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 914ba7ddede7bd2d16367cdf5a66138904ae612a-PR-9

Details

  • 38 of 79 (48.1%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-6.5%) to 81.964%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/agent_forge/notification/registry.ex 9 11 81.82%
lib/agent_forge/notification/channels/console.ex 0 3 0.0%
lib/agent_forge/plugin_manager.ex 22 25 88.0%
lib/agent_forge/plugins/http.ex 0 33 0.0%
Totals Coverage Status
Change from base Build 5e8b12ab88580b78552e86360036718e734453af: -6.5%
Covered Lines: 409
Relevant Lines: 499

💛 - Coveralls

@madawei2699 madawei2699 merged commit d1471e7 into main Mar 26, 2025
1 check passed
@madawei2699 madawei2699 deleted the feature/plugin-system branch March 26, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants